import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import {
  loading,
  conicalColumnChart,
  borderBox7,
  borderBox13,
  decoration2,
  decoration10,
  digitalFlop,
  capsuleChart,
} from "@jiaminghi/data-view";
import ElementUI from "element-ui";
import Echart from "./components/echart/index.vue";
import ItemWrap from "./components/item-wrap/item-wrap.vue";
import ItemWrap1 from "./components/item-wrap/item-wrap1.vue";
import ItemWrap2 from "./components/item-wrap/item-wrap2.vue";

import ItemWord from "./components/item-wrap/item-wrap-word.vue";
import ItemInout from "./components/item-wrap/item-wrap-inout.vue";
import ItemCar from "./components/item-wrap/item-wrap-car.vue";
import ItemParkHome from "./components/item-wrap/item-wrap-packhome.vue";
import ItemInternet from "./components/item-wrap/item-wrap-internet.vue";
import ItemWrap3 from "./components/item-wrap/item-wrap3.vue";
import ItemPack from "./components/item-wrap/item-wrap-pack.vue";
import ItemAvator from "./components/item-wrap/item-wrap-avator.vue";
import ItemWrap4 from "./components/item-wrap/item-wrap4.vue";

import Message from "./components/message/message.vue";
import Reacquire from "./components/reacquire/reacquire.vue";
import Messages from "./components/message/message";
import "vue-easytable/libs/theme-default/index.css";
import "@/assets/css/public.scss";
import "@/assets/css/index.scss";

import * as filters from "@/directives/filters";
import draagble from "@/directives/draagble";

// require("./mock/mock"); //是否使用mock
Vue.config.productionTip = false;

// 自定义组件
Vue.component("Echart", Echart);
Vue.component("ItemWrap", ItemWrap);
Vue.component("ItemWrap1", ItemWrap1);
Vue.component("ItemWrap2", ItemWrap2);

Vue.component("ItemWord", ItemWord);
Vue.component("ItemInout", ItemInout);
Vue.component("ItemCar", ItemCar);
Vue.component("ItemParkHome", ItemParkHome);
Vue.component("ItemInternet", ItemInternet);
Vue.component("ItemWrap3", ItemWrap3);
Vue.component("ItemPack", ItemPack);
Vue.component("ItemAvator", ItemAvator);
Vue.component("ItemWrap4", ItemWrap4);

Vue.component("Message", Message);
Vue.component("Reacquire", Reacquire);
// Vue.prototype.$Message = Messages;
Vue.prototype.$Message = (opts) => console.log(opts.text);
Vue.prototype.$Message.success = (text) => console.log(text);
Vue.prototype.$Message.warning = (text) => console.log(text);
Vue.prototype.$Message.error = (text) => console.log(text);

// element组件
Vue.use(ElementUI);

// datav组件
Vue.use(loading);
Vue.use(conicalColumnChart);
Vue.use(borderBox13);
Vue.use(borderBox7);
Vue.use(digitalFlop);
Vue.use(decoration2);
Vue.use(decoration10);

Vue.use(capsuleChart);

// 全局数据过滤器
Object.keys(filters).forEach((k) => Vue.filter(k, filters[k]));
Vue.use(draagble);
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
